VERSION 5.00
Begin VB.Form Form2 
   Caption         =   "Impiccato"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4860
   LinkTopic       =   "Form2"
   ScaleHeight     =   3090
   ScaleWidth      =   4860
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox txtok 
      Height          =   285
      Left            =   0
      TabIndex        =   34
      Text            =   "Text1"
      Top             =   3480
      Visible         =   0   'False
      Width           =   150
   End
   Begin VB.CommandButton a 
      Caption         =   "A"
      Height          =   375
      Left            =   0
      Style           =   1  'Graphical
      TabIndex        =   29
      Top             =   1800
      Width           =   375
   End
   Begin VB.CommandButton b 
      Caption         =   "B"
      Height          =   375
      Left            =   360
      Style           =   1  'Graphical
      TabIndex        =   28
      Top             =   1800
      Width           =   375
   End
   Begin VB.CommandButton c 
      Caption         =   "C"
      Height          =   375
      Left            =   720
      Style           =   1  'Graphical
      TabIndex        =   27
      Top             =   1800
      Width           =   375
   End
   Begin VB.CommandButton d 
      Caption         =   "D"
      Height          =   375
      Left            =   1080
      Style           =   1  'Graphical
      TabIndex        =   26
      Top             =   1800
      Width           =   375
   End
   Begin VB.CommandButton e 
      Caption         =   "E"
      Height          =   375
      Left            =   1440
      Style           =   1  'Graphical
      TabIndex        =   25
      Top             =   1800
      Width           =   375
   End
   Begin VB.CommandButton f 
      Caption         =   "F"
      Height          =   375
      Left            =   1800
      Style           =   1  'Graphical
      TabIndex        =   24
      Top             =   1800
      Width           =   375
   End
   Begin VB.CommandButton g 
      Caption         =   "G"
      Height          =   375
      Left            =   2160
      Style           =   1  'Graphical
      TabIndex        =   23
      Top             =   1800
      Width           =   375
   End
   Begin VB.CommandButton h 
      Caption         =   "H"
      Height          =   375
      Left            =   2520
      Style           =   1  'Graphical
      TabIndex        =   22
      Top             =   1800
      Width           =   375
   End
   Begin VB.CommandButton i 
      Caption         =   "I"
      Height          =   375
      Left            =   2880
      Style           =   1  'Graphical
      TabIndex        =   21
      Top             =   1800
      Width           =   375
   End
   Begin VB.CommandButton j 
      Caption         =   "J"
      Height          =   375
      Left            =   3240
      Style           =   1  'Graphical
      TabIndex        =   20
      Top             =   1800
      Width           =   375
   End
   Begin VB.CommandButton cmdcontr 
      Caption         =   "Risposta"
      Height          =   375
      Left            =   1920
      Style           =   1  'Graphical
      TabIndex        =   19
      Top             =   2640
      Width           =   1095
   End
   Begin VB.CommandButton cmdarr 
      Caption         =   "Arrenditi"
      Height          =   375
      Left            =   3360
      Style           =   1  'Graphical
      TabIndex        =   18
      Top             =   2640
      Width           =   1095
   End
   Begin VB.TextBox txtpa 
      Alignment       =   2  'Center
      BackColor       =   &H8000000F&
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   18
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   555
      Index           =   0
      Left            =   120
      TabIndex        =   17
      Text            =   "_"
      Top             =   720
      Width           =   420
   End
   Begin VB.CommandButton k 
      Caption         =   "K"
      Height          =   375
      Left            =   3600
      Style           =   1  'Graphical
      TabIndex        =   16
      Top             =   1800
      Width           =   375
   End
   Begin VB.CommandButton n 
      Caption         =   "N"
      Height          =   375
      Left            =   0
      Style           =   1  'Graphical
      TabIndex        =   15
      Top             =   2160
      Width           =   375
   End
   Begin VB.CommandButton o 
      Caption         =   "O"
      Height          =   375
      Left            =   360
      Style           =   1  'Graphical
      TabIndex        =   14
      Top             =   2160
      Width           =   375
   End
   Begin VB.CommandButton p 
      Caption         =   "P"
      Height          =   375
      Left            =   720
      Style           =   1  'Graphical
      TabIndex        =   13
      Top             =   2160
      Width           =   375
   End
   Begin VB.CommandButton q 
      Caption         =   "Q"
      Height          =   375
      Left            =   1080
      Style           =   1  'Graphical
      TabIndex        =   12
      Top             =   2160
      Width           =   375
   End
   Begin VB.CommandButton r 
      Caption         =   "R"
      Height          =   375
      Left            =   1440
      Style           =   1  'Graphical
      TabIndex        =   11
      Top             =   2160
      Width           =   375
   End
   Begin VB.CommandButton s 
      Caption         =   "S"
      Height          =   375
      Left            =   1800
      Style           =   1  'Graphical
      TabIndex        =   10
      Top             =   2160
      Width           =   375
   End
   Begin VB.CommandButton t 
      Caption         =   "T"
      Height          =   375
      Left            =   2160
      Style           =   1  'Graphical
      TabIndex        =   9
      Top             =   2160
      Width           =   375
   End
   Begin VB.CommandButton u 
      Caption         =   "U"
      Height          =   375
      Left            =   2520
      Style           =   1  'Graphical
      TabIndex        =   8
      Top             =   2160
      Width           =   375
   End
   Begin VB.CommandButton v 
      Caption         =   "V"
      Height          =   375
      Left            =   2880
      Style           =   1  'Graphical
      TabIndex        =   7
      Top             =   2160
      Width           =   375
   End
   Begin VB.CommandButton l 
      Caption         =   "L"
      Height          =   375
      Left            =   3960
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   1800
      Width           =   375
   End
   Begin VB.CommandButton m 
      Caption         =   "M"
      Height          =   375
      Left            =   4320
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   1800
      Width           =   375
   End
   Begin VB.CommandButton w 
      Caption         =   "W"
      Height          =   375
      Left            =   3240
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   2160
      Width           =   375
   End
   Begin VB.CommandButton x 
      Caption         =   "X"
      Height          =   375
      Left            =   3600
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   2160
      Width           =   375
   End
   Begin VB.CommandButton y 
      Caption         =   "Y"
      Height          =   375
      Left            =   3960
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   2160
      Width           =   375
   End
   Begin VB.CommandButton z 
      Caption         =   "Z"
      Height          =   375
      Left            =   4320
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   2160
      Width           =   375
   End
   Begin VB.TextBox txtrisp 
      BackColor       =   &H8000000F&
      Height          =   375
      Left            =   120
      TabIndex        =   0
      Text            =   "Risposta"
      Top             =   2640
      Width           =   1455
   End
   Begin VB.Line Line12 
      X1              =   4200
      X2              =   4200
      Y1              =   0
      Y2              =   120
   End
   Begin VB.Line Line11 
      X1              =   3600
      X2              =   4200
      Y1              =   0
      Y2              =   0
   End
   Begin VB.Line Line10 
      X1              =   3600
      X2              =   3600
      Y1              =   960
      Y2              =   0
   End
   Begin VB.Line Line9 
      X1              =   3480
      X2              =   3840
      Y1              =   960
      Y2              =   960
   End
   Begin VB.Line Line8 
      Visible         =   0   'False
      X1              =   3840
      X2              =   4560
      Y1              =   0
      Y2              =   1080
   End
   Begin VB.Line Line7 
      Visible         =   0   'False
      X1              =   4320
      X2              =   4440
      Y1              =   960
      Y2              =   960
   End
   Begin VB.Line Line6 
      Visible         =   0   'False
      X1              =   4080
      X2              =   3960
      Y1              =   960
      Y2              =   960
   End
   Begin VB.Line Line5 
      Visible         =   0   'False
      X1              =   4200
      X2              =   4320
      Y1              =   840
      Y2              =   960
   End
   Begin VB.Line Line4 
      Visible         =   0   'False
      X1              =   4200
      X2              =   4080
      Y1              =   840
      Y2              =   960
   End
   Begin VB.Line Line3 
      Visible         =   0   'False
      X1              =   4200
      X2              =   4440
      Y1              =   480
      Y2              =   720
   End
   Begin VB.Line Line2 
      Visible         =   0   'False
      X1              =   4200
      X2              =   3960
      Y1              =   480
      Y2              =   720
   End
   Begin VB.Line Line1 
      Visible         =   0   'False
      X1              =   4200
      X2              =   4200
      Y1              =   360
      Y2              =   840
   End
   Begin VB.Shape Shape1 
      Height          =   255
      Left            =   3960
      Top             =   120
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.Label lblinfo 
      Caption         =   "Errori rimanenti:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1080
      TabIndex        =   33
      Top             =   0
      Width           =   2055
   End
   Begin VB.Label lblscritta 
      Alignment       =   2  'Center
      Caption         =   "Parola:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1920
      TabIndex        =   32
      Top             =   360
      Width           =   975
   End
   Begin VB.Label lblrimane 
      Caption         =   "9"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3240
      TabIndex        =   31
      Top             =   0
      Width           =   255
   End
   Begin VB.Label lbllunga 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1920
      TabIndex        =   30
      Top             =   1320
      Width           =   735
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim parolachiave As String
Dim ind As Integer
Dim tot As String
Dim cont As Integer
Dim tot2 As Integer

Private Sub cmdarr_Click()
MsgBox ("Hai perso!!")
End
End Sub

Private Sub Form_Load()
cont = 0
tot2 = 0
ind = 1
parolachiave = Form1.txtnome.Text
txtok.Text = parolachiave
lbllunga.Caption = Len(txtok.Text)
Dim p
Dim max
max = 1
For p = 1 To (Len(txtok.Text) - 1)
Load txtpa(max)
txtpa(max).Left = txtpa(max - 1).Left + 480
txtpa(max).Visible = True
txtpa(max).Height = 495
txtpa(max).Width = 420
If txtpa(max).Left > 4440 Then
Form2.Width = txtpa(max).Left + 600
End If
max = max + 1
Next p
End Sub

Public Sub find(x)
Dim t
Dim res As Boolean
res = False
For t = 1 To Len(txtok.Text)
If Mid(parolachiave, ind, 1) = x Then
txtpa(ind - 1).Text = x
tot2 = tot2 + 1
res = True
cont = cont + 1
End If
ind = ind + 1
Next t
ind = 1
If res = False Then
lblrimane.Caption = lblrimane.Caption - 1
ElseIf res = True And Len(parolachiave) = cont Then
MsgBox ("Complimenti, hai vinto!!!")
End
End If
If lblrimane.Caption = 8 Then
Shape1.Visible = True
ElseIf lblrimane.Caption = 7 Then
Line1.Visible = True
ElseIf lblrimane.Caption = 6 Then
Line2.Visible = True
ElseIf lblrimane.Caption = 5 Then
Line3.Visible = True
ElseIf lblrimane.Caption = 4 Then
Line4.Visible = True
ElseIf lblrimane.Caption = 3 Then
Line5.Visible = True
ElseIf lblrimane.Caption = 2 Then
Line6.Visible = True
ElseIf lblrimane.Caption = 1 Then
Line7.Visible = True
ElseIf lblrimane.Caption = 0 Then
Line8.Visible = True
MsgBox ("Hai perso!!")
End
End If
End Sub

Private Sub cmdcontr_Click()
If txtrisp.Text = parolachiave Then
MsgBox ("Hai vinto!!!")
End
Else
MsgBox ("Mi dispiace. Hai perso!!!")
End If
End
End Sub

Private Sub a_Click()
Call find("a")
a.Enabled = False
End Sub

Private Sub b_Click()
Call find("b")
b.Enabled = False
End Sub

Private Sub c_Click()
Call find("c")
c.Enabled = False
End Sub

Private Sub d_Click()
Call find("d")
d.Enabled = False
End Sub

Private Sub e_Click()
Call find("e")
e.Enabled = False
End Sub

Private Sub f_Click()
Call find("f")
f.Enabled = False
End Sub

Private Sub g_Click()
Call find("g")
g.Enabled = False
End Sub

Private Sub h_Click()
Call find("h")
h.Enabled = False
End Sub

Private Sub i_Click()
Call find("i")
i.Enabled = False
End Sub

Private Sub j_Click()
Call find("j")
j.Enabled = False
End Sub

Private Sub k_Click()
Call find("k")
k.Enabled = False
End Sub

Private Sub l_Click()
Call find("l")
l.Enabled = False
End Sub

Private Sub m_Click()
Call find("m")
m.Enabled = False
End Sub

Private Sub n_Click()
Call find("n")
n.Enabled = False
End Sub

Private Sub o_Click()
Call find("o")
o.Enabled = False
End Sub

Private Sub p_Click()
Call find("p")
p.Enabled = False
End Sub

Private Sub q_Click()
Call find("q")
q.Enabled = False
End Sub

Private Sub r_Click()
Call find("r")
r.Enabled = False
End Sub

Private Sub s_Click()
Call find("s")
s.Enabled = False
End Sub

Private Sub t_Click()
Call find("t")
t.Enabled = False
End Sub

Private Sub txtrisp_Click()
txtrisp.Text = ""
End Sub

Private Sub u_Click()
Call find("u")
u.Enabled = False
End Sub

Private Sub v_Click()
Call find("v")
v.Enabled = False
End Sub

Private Sub w_Click()
Call find("w")
w.Enabled = False
End Sub

Private Sub x_Click()
Call find("x")
x.Enabled = False
End Sub

Private Sub y_Click()
Call find("y")
y.Enabled = False
End Sub

Private Sub z_Click()
Call find("z")
z.Enabled = False
End Sub

